<template>
  <!-- 兄弟组件传值测试 -->
  <div>
    <MyInput @add="myAdd"/>
    <MyList :text-list="myTextList"/>
  </div>
</template>

<script>
  import MyInput from '../../components/Input';
  import MyList from '../../components/List'

  export default {
    name: 'BrotherCpnComTest',
    components: {
      MyInput,
      MyList
    },
    data() {
      return {
        myTextList: [
          {
            id: 1,
            title: "标题1"
          }
        ]
      }
    },
    methods: {
      myAdd(title) {
        if (title !== '') {
          this.myTextList.push({
            id: 2,
            title: title
          })
        }
      }
    }
  }
</script>

<style scoped>

</style>
